/**
 * 	 Copyright (c) 2008, 2009 Lukas Zaruba
 * 
 *   This file is part of UniAnalyzer (Universal Analyzer).
 *
 *   UniAnalyzer is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU Lesser General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   UniAnalyzer is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU Lesser General Public License for more details.
 *
 *   You should have received a copy of the GNU Lesser General Public License
 *   along with UniAnalyzer. If not, see <http://www.gnu.org/licenses/>.
 */


package net.zarubsys.unianalyzer.dataminers.lpt.gui.wizard;

import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;

/**
 * LPTMeasuringNamePage
 *
 * @author  &lt;A HREF=&quot;mailto:lukas.zaruba@gmail.com&quot;&gt;Lukas Zaruba&lt;/A&gt
 * @version $Revision$ $Date$
 */
public class LPTMeasuringNamePage extends AbstractPageWithContext {

	private Text name;
	private Text description;

	public LPTMeasuringNamePage(String pageName) {
		super(pageName);
	}

	public void createControl(Composite parent) {
		Composite composite = new Composite(parent, SWT.NONE);
		composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
		composite.setLayout(new GridLayout(1, false));
		
		GridData gd;
		Label label;
		
		label = new Label(composite, SWT.NONE);
		label.setLayoutData(new GridData(SWT.BEGINNING, SWT.CENTER, false, false));
		label.setText(Messages.getString("LPTMeasuringNamePage.name")); //$NON-NLS-1$
		
		name = new Text(composite, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
		gd = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
		gd.widthHint = 300;
		name.setLayoutData(gd);
		name.addModifyListener(new ModifyListener() {

			public void modifyText(ModifyEvent e) {
				Text t = (Text) e.widget;
				getMeasurignSettings().setName(t.getText());
			}
			
		});
		
		label = new Label(composite, SWT.NONE);
		gd = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
		label.setLayoutData(gd);
		label.setText(Messages.getString("LPTMeasuringNamePage.description")); //$NON-NLS-1$
		
		description = new Text(composite, SWT.MULTI | SWT.LEAD | SWT.BORDER);
		gd = new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
		gd.widthHint = 450;
		gd.heightHint = 50;
		description.setLayoutData(gd);
		description.addModifyListener(new ModifyListener() {
			
			public void modifyText(ModifyEvent e) {
				Text t = (Text) e.widget;
				getMeasurignSettings().setDescription(t.getText());
			}
			
		});
		
		setControl(composite);

	}

}


/*
 * $Log$
 */